package com.eva.learn.concurrent.util;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class Test {
public static void main(String[] args) throws InterruptedException {
	Lock lock = new ReentrantLock();
	System.out.println(lock.toString());
	lock.lock();
	lock.lock();
	ExecutorService executorService = Executors.newSingleThreadExecutor();
	TestRun testRun = new TestRun(lock);
	executorService.execute(testRun);
	Thread.currentThread().sleep(1000l);
	System.out.println("1");
	lock.unlock();
}
}
